<template>
  <div>
    <div id="nav" class="continue">
      <div class="row">
        <nav class="col-11 mx-auto">
          <ul class="nav justify-content-center">
            <li class="col-8"></li>
            <li
              class="nav-item"
              :class="{ select: getNowPage == index }"
              v-for="(p, index) in pageList"
              :key="index"
            >
              <router-link :to="p.src">
                <a
                  class="nav-link"
                  href="javasctipt:;"
                  @click="getNowPage = index"
                  >{{ p.name }}</a
                >
              </router-link>
            </li>
          </ul>
        </nav>
      </div>
    </div>
  </div>
</template>

<script>
export default {
  props: {
    nowPage: {
      type: Number,
      default: 0,
    },
  },
  data() {
    return {
      pageList: [
        { name: "书籍", src: "/keepHealth-book" },
        { name: "四季养生", src: "/keepHealth-season" },
        { name: "24小时养生", src: "/keepHealth-hour" },
      ],
    };
  },
  computed: {
    getNowPage: {
      get() {
        return this.nowPage;
      },
      set() {},
    },
  },
  created() {},
  mounted() {},
  methods: {},
};
</script>

<style scoped>
#nav {
  height: 60px;
  font-size: 20px;
  font-weight: 700;
  /* background-color: #6159e6; */
}
#nav nav {
  border-bottom: 2px solid #6159e6;
}
#nav .row {
  height: 40px;
}
#nav .nav {
  height: 40px;
}
#nav .nav-item {
  /* height: 50px; */
  text-align: center;
}
#nav .nav-item > a > a {
  position: relative;
  display: inline-block;
  padding: 0 0px;
  margin: 5px 10px;
  /* box-sizing: border-box; */
  line-height: 30px;
  color: #ccc;
  transition: color 0.2s;
}
/* #nav .nav-item a::before {
  content: "";
  display: none;
  position: absolute;
  width: 0;
  height: 0;
  left: calc(50% - 12px);
  bottom: -6px;
  border-width: 12px;
  border-style: solid;
  border-color: transparent transparent white transparent;
} */
#nav .nav-item a:hover {
  color: #ddd;
}
#nav .nav-item.select a {
  color: #ff9624;
}
/* #nav .nav-item.select a::before {
  display: block;
} */
</style>
